<!-- 代理商反点 -->
<template>
    <div>
        <el-form ref="form" class="form" :model="form" label-width="80px" label-position='right'>
            <!-- <el-form-item label="商家销售抽佣" label-width="auto">
                <el-input v-model="form.addAdvertisementPercentage"></el-input>
            </el-form-item> -->
            <!-- <el-form-item label="代理费" label-width="auto">
                <el-input v-model="form.agencyFee"></el-input>
            </el-form-item> -->
            <div>
                <h1>
                    代理商分佣设置
                </h1>
                <el-form-item label="广告分佣比例" placeholder="请输入小数" label-width="auto">
                    <el-input placeholder="请输入小数" v-model="form.addAdvertisementPercentage"></el-input>
                </el-form-item>
                <el-form-item label="用户音视频，打赏，送礼，视频加热，VIP充值抽佣 " placeholder="请输入小数" label-width="auto">
                    <el-input placeholder="请输入小数" v-model="form.commissionAmountPercentage"></el-input>
                </el-form-item>
                <el-form-item label="一级代理商对二级代理商抽取佣金数" placeholder="请输入小数" label-width="auto">
                    <el-input placeholder="请输入小数" v-model="form.returnPointPercentage"></el-input>
                </el-form-item>
                <el-form-item label="保证金金额" label-width="auto">
                    <el-input placeholder="请输入整数" v-model="form.securityDeposit"></el-input>
                </el-form-item>

                <el-form-item label="分销用户购物佣金比例" label-width="auto">
                    <el-input placeholder="请输入小数" v-model="form.buyCommodityPercentage"></el-input>
                </el-form-item>
                <h1>KPI指标</h1>

                <el-form-item label="团购商家数量" label-width="auto">
                    <el-input placeholder="请输入指标" v-model="form.numberOfGroupBuyingMerchants"></el-input>
                </el-form-item>
                <el-form-item label="线上商家数量" label-width="auto">
                    <el-input placeholder="请输入指标" v-model="form.numberOfOnlineMerchants"></el-input>
                </el-form-item>
                <el-form-item label="规定月份数" label-width="auto">
                    <el-input placeholder="请输入月数" v-model="form.fixedMonthTime"></el-input>
                </el-form-item>
                <el-form-item label="二级代理商发展数量" label-width="auto">
                    <el-input placeholder="请输入指标" v-model="form.numberOfSecondaryAgents"></el-input>
                </el-form-item>
                <el-form-item label="拉新用户数量" label-width="auto">
                    <el-input placeholder="请输入指标" v-model="form.theNumberOfNewUsers"></el-input>
                </el-form-item>
                <el-form-item label="完成任务奖励金" label-width="auto">
                    <el-input placeholder="请输入指标" v-model="form.bonusForCompletingTasks"></el-input>
                </el-form-item>
                <el-form-item>
                    <el-button type="primary" @click="onSubmit">立即设置</el-button>

                </el-form-item>
            </div>

        </el-form>
    </div>
</template>

<script>

export default {
    name: 'drawCommission',
    mounted() {
        this.getDetail()

    },
    data() {
        return {
            form: {

            }
        }
    },
    methods: {
        async getDetail() {
            console.log('打印');
            let res = await this.$API.members.getAdvertisementUserMetricData()
            if (res.code == 200) {
                this.form = res.data
            }
            console.log(this.form, 'form');
        },
        async onSubmit() {
            let res = await this.$API.shop.setAdvertisementUserMetricData(
                this.form
            )
            if (res.code == 200) {
                this.$message("修改成功")
            }

        }
    }
}
</script>

<style scoped lang="scss">
.el-form-item {
    display: flex;


}

.label {
    width: 200px;
}

.form {
    margin-left: 70px;
    width: 600px;

    .el-form-item {
        justify-content: flex-end;
    }
}
</style>